<include file="Public:header" />
<notempty name="tasks">
<table class="table table-striped">
	<tr>
		<th>{:L('_ID')}</th>
		<th>{:L('_AUDIT_LIST')}</th>
		<th>{:L('_BRAND')}</th>
		<th>{:L('_IMAGE')}</th>
		<th>{:L('_OPERATING')}</th>
	</tr>
	<foreach name="tasks" item="task">
	<tr id="task-{$task.id}">
		<td>{$task.id}</td>
		<td><a href="{:U('/Task/Audit/task/id')}/{$task.id}">{$task.title}</a>
		</td>
		<td>{$task.brand.name}</td>
		<td><img src="{$task.image_url}" /></td>
		<td><input class="btn pass btn-primary" data-id="{$task.id}" onclick=""
			value="{:L('_PASS')}"></td>
	</tr>
	</foreach>
</table>
</notempty>
<include file="Public:footer" />
<script type="text/javascript" src="__STATIC__/task/js/audit.js"></script>
<script type="text/javascript">
	$(function() {
		$('input.pass').click(function(){
			var id = $(this).data('id');
			var url = "{:U('/Task/Audit/task/id')}/" + id;
			$.post(url, {audit:'通过'},
			function(data){
				if(data.status){
					$('#task-'+id).remove();//移除显示
				}else{
					alert('审核失败提示：'+data.info);
				}
			  },
			  "json");
			}
		);
	});
</script>